﻿using Mes.Domain.BoundedContext;

namespace Mes.Application.DTO.Inputs.MasterData
{
    /// <summary>
    /// 新增清单物料入参
    /// </summary>
    public class AddMaterialBOMInput
    {
        /// <summary>
        /// 物料清单编码
        /// </summary>
        public string Code { get; set; } = string.Empty;

        /// <summary>
        ///物料清单名称
        /// </summary>
        public string Name { get; set; } = string.Empty;

        /// <summary>
        /// 物料清单版本
        /// </summary>
        public string Version { get; set; } = string.Empty;

        /// <summary>
        /// 物料清单备注
        /// </summary>
        public string Remark { get; set; } = string.Empty;

        /// <summary>
        /// 物料列表
        /// </summary>
        //public IList<int> MaterialIds { get; set; } = new List<int>();
        public IList<MaterialContainNumberResult> Materials { get; set; } = new List<MaterialContainNumberResult>();
    }

    /// <summary>
    /// 包含数量的物料
    /// </summary>
    public class MaterialContainNumberResult
    {
        /// <summary>
        /// 物料Id
        /// </summary>
        public int MaterialId { get; set; }

        /// <summary>
        /// 物料数量
        /// </summary>
        public double MaterialNumber { get; set; } = 1000;
    }

    /// <summary>
    /// 编辑清单物料入参
    /// </summary>
    public class UpdateMaterialBOMInput
    {
        /// <summary>
        /// 物料清单Id
        /// </summary>
        public int Id { get; set; }
        /// <summary>
        /// 物料清单版本
        /// </summary>
        public string Version { get; set; } = string.Empty;

        /// <summary>
        /// 物料清单备注
        /// </summary>
        public string Remark { get; set; } = string.Empty;

        /// <summary>
        /// 物料列表
        /// </summary>
        //public IList<int> MaterialIds { get; set; } = new List<int>();
        public IList<MaterialContainNumberResult> Materials { get; set; } = new List<MaterialContainNumberResult>();
    }

    /// <summary>
    /// 查询物料清单入参
    /// </summary>
    public class GetMaterialBOMsInput
    {
        /// <summary>
        /// 查询关键字
        /// </summary>
        public string? KeyWord { get; set; }

        /// <summary>
        /// 分页参数
        /// </summary>
        public PagedInput PagedInput { get; set; } = new PagedInput();
    }

    /// <summary>
    /// 移除物料清单绑定的物料
    /// </summary>
    public class RemoveMaterialOfMaterialBOMInput
    {
        /// <summary>
        /// 物料清单Id
        /// </summary>
        public int MaterialBOMId { get; set; }
        /// <summary>
        /// 物料Id
        /// </summary>
        public int MaterialId { get; set; }
    }
}
